import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Main {
	public static void main(String[] args) throws Exception{
		//Accessing driver form the JAR file
		Class.forName("com.mysql.jdbc.Driver");
		
		//Creating a variable for the connection called "con"
		Connection con = DriverManager.getConnection("jdbc:mysql://10.10.0.5:3306/test","sifoclocal","usersifoclocal");
		
		//Here we create our query
		PreparedStatement statement = con.prepareStatement("select * from test1");
		
		//Creating a variable to execute query
		ResultSet result = statement.executeQuery();
		
		while(result.next())
		{
			System.out.println(result.getString(1) + " " + result.getString(2) + " " + result.getString(3));
			
		}
	}
}
